module.exports = (app) => {
    const { STRING, TEXT, INTEGER, DATE } = app.Sequelize;

    const CertificateConfig = app.model.define(
        "certificate-config",
        {
            id: {
                type: INTEGER,
                primaryKey: true,
                autoIncrement: true,
            },
            certificateName: {
                type: STRING(255),
                allowNull: false,
            },
            certificateRules: {
                type: TEXT,
                allowNull: false,
            },

            createdAt: {
                type: DATE,
            },
            updatedAt: {
                type: DATE,
            },

            isActive: {
                type: INTEGER,
                defaultValue: 0,
            },
        },
        {
            timestamps: true,
            underscored: false,
        }
    );

    return CertificateConfig;
};